library(ggplot2)
library(ggExtra)

p <- ggplot(mtcars, aes(x = wt, y = mpg, color = cyl, size = cyl)) +
    geom_point() +
    theme(legend.position = 'none')

ggMarginal(p, type = 'histogram', size = 10)

ggMarginal(p, type = 'histogram', fill = 'slateblue', xparams = list(bins = 10))

ggMarginal(p, margins = 'x', color = 'purple', size = 4)

ggMarginal(p, type = 'density')

ggMarginal(p, type = 'boxplot')
